package com.example.managesystem.mapper;

import com.example.managesystem.dto.TimeDto;
import lombok.Data;
import org.apache.ibatis.annotations.*;

import java.util.Date;

@Mapper

public interface TimeMapper {


    /**
     * 修改发布时间
     * @param timedto
     */
    @Update("update time set setup_start=#{timedto.setupStart},setup_end=#{timedto.setupEnd},miditem_start=#{timedto.miditemStart},miditem_end=#{timedto.miditemEnd},completed_start=#{timedto.completedStart},completed_end=#{timedto.completedEnd} where time_id=#{timeId}")
    void updateTime(@Param("timeId")Integer timeId,@Param("timedto") TimeDto timedto);


    @Select("select setup_start from time where time_id=#{id}")
    String getSetupStartTime(Integer id);
    @Select("select miditem_start from time where time_id=#{id}")
    String getMiditemStartTime(Integer id);
    @Select("select completed_start from time where time_id=#{id}")
    String getCompletedStartTime(Integer id);
    @Select("select setup_end from time where time_id=#{id}")
    String getSetupEndTime(Integer id);
    @Select("select miditem_end from time where time_id=#{id}")
    String getMiditemEndTime(Integer id);
    @Select("select completed_end from time where time_id=#{id}")
    String getCompletedEndTime(Integer id);
}
